home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19990725-20000114 / 000097_news@columbia.edu _Tue Sep 14 18:21:57 1999.msg < prev    next >
Internet Message Format  |  2020-01-01  |  3KB

  1. Return-Path: <news@columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id SAA02152
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Tue, 14 Sep 1999 18:21:56 -0400 (EDT)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id SAA14955
  7.     for kermit.misc@watsun.cc.columbia.edu; Tue, 14 Sep 1999 18:10:27 -0400 (EDT)
  8. X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
  9. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  10. Subject: Re: How do I pass Kermit parameters?
  11. Date: 14 Sep 1999 22:10:25 GMT
  12. Organization: Columbia University
  13. Message-ID: <7rmh4h$ej8$1@newsmaster.cc.columbia.edu>
  14. To: kermit.misc@columbia.edu
  15.  
  16. In article <7rm5g7$v0a$1@nnrp1.deja.com>,  <dixonan@my-deja.com> wrote:
  17. : I want to pass Kermit parameters from my Visual Basic program.
  18. : Example:  If the user wants info about product 18, I want Kermit to
  19. : submit a program on an alpha machine which will get the info for
  20. : product 18.
  21. : In Visual Basic 6.0 I'm shelling the command...
  22. :                         f:\winappl.95\k95\k95 d:login.ksc
  23. : (d:login.ksc is the script I've written which runs on an NT box)
  24. : The script runs fine I just don't know where/how to tell it to run for
  25. : product 18.
  26. The methods for passing command-line arguments to a script are a bit
  27. awkward, since K95 (and C-Kermit 6.0, upon which it is based) have
  28. their own command-line arguments.  All of this will be simplified in the
  29. next releases (C-Kermit 7.0 and K95 1.1.18), but for the time being, you
  30. have two choices.  The first one is:
  31.  
  32.   <path>k95 <name-of-script-file> = <arg1> <arg2> ...
  33.  
  34. The "=" is a K95 / C-Kermit command-line argument meaning "ignore 
  35. everything that follows but put it in the command-line argument array,"
  36. which is described on p.353 and p.469 of "Using C-Kermit".  But then your
  37. script has to loop through the command-line argument array looking for the
  38. "=" sign, and then pick up its own arguments after the "=" sign.  Example:
  39.  
  40.   f:\winappl.95\k95\k95 d:myscript.ksc = 18
  41.  
  42. where myscript.ksc might contain:
  43.  
  44.   undef product
  45.   for \%i 1 \v(args)-1 1 {
  46.       xif equal {\&@[\%i]} {=} {
  47.           assign product \&@[\%i+1]
  48.           break
  49.       }
  50.   }
  51.   if not def product stop 1 Product number required
  52.   echo product = "\m(product)"
  53.  
  54. The other method would be to use the -C "commandlist" construction:  
  55.  
  56.   f:\winappl.95\k95\k95 -C "define product 18, take d:myscript.ksc"
  57.  
  58. Using either method, your script can refer to the product code as
  59. \m(product).
  60.  
  61. - Frank